package cn.cloud9.jax_ws.client;

import cn.cloud9.jax_ws.client.intf.demo.WeatherInterfaceImpl;
import cn.cloud9.jax_ws.client.intf.demo.WeatherInterfaceImplService;

import java.io.UnsupportedEncodingException;


/**
 * @author OnCloud9
 * @description
 * @project JAX-WS-Client
 * @date 2022年04月23日 11:31
 */
public class WeatherClient {

    public static void main(String[] args) throws UnsupportedEncodingException {
        // 创建服务视图
        final WeatherInterfaceImplService implService =
                new WeatherInterfaceImplService();

        // 获取服务实现类
        final WeatherInterfaceImpl instance =
                implService.getPort(WeatherInterfaceImpl.class);

        String city = "南昌";

        // 调用查询方法
        final String queryWeather = instance.queryWeather(new String(city.getBytes("GBK")));
        System.out.println(queryWeather);
    }
}
